/* eslint-disable import/prefer-default-export */
import request from '@/utils/request';

// 查询材料
export async function templateList(params, activeKey) {
  switch (Number(activeKey)) {
    case 1:
      return request(`/esApi/emlMsg/pageList`, {
        method: 'POST',
        body: {
          ...params,
        },
      });
    // break;
    case 2:
      return request(`/esApi/entryInformApi/pageEntryInformList`, {
        method: 'POST',
        body: {
          ...params,
        },
      });
    // break;
    default:
      return request(`/esApi/matPkg/pagePkgList`, {
        method: 'POST',
        body: {
          ...params,
        },
      });
  }
}
export async function areaListData(params) {
  return request(`/esApi/suppBusiScope/getAreaList`, {
    method: 'POST',
    body: params,
  });
}
export async function delTemplateList(params) {
  return request(`/esApi/emlMsg/deleteEmlMsg`, {
    method: 'POST',
    body: params,
  });
}
export async function delInforList(params) {
  return request(`/esApi/entryInformApi/deleteEntry`, {
    method: 'POST',
    body: params,
  });
}
export async function delMatList(params) {
  return request(`/esApi/matPkg/delete`, {
    method: 'POST',
    body: params,
  });
}

// 产品
export async function getPdList(params) {
  return request(`/esApi/baseProductQuery/queryPdInfoList`, {
    method: 'POST',
    body: params,
  });
}
// 详情
export async function getMatDetail(params) {
  return request(`/esApi/matPkg/getMatPkgById`, {
    method: 'POST',
    body: params,
  });
}
// 是否五险合一
export async function getAreaInsUnify(params) {
  return request(`/esApi/operParam/queryParamByArea`, {
    method: 'POST',
    body: params,
  });
}

//
export async function getDictAss(params) {
  return request(`/esApi/mdm/nmDict/queryDictItemsByCodes`, {
    method: 'POST',
    body: params,
  });
}
export async function getCorpDict(params) {
  return request(`/esApi/corpDict/listCorpDict`, {
    method: 'POST',
    body: params,
  });
}

export async function save(params) {
  return request(`/esApi/matPkg/insert`, {
    method: 'POST',
    body: params,
  });
}
export async function update(params) {
  return request(`/esApi/matPkg/update`, {
    method: 'POST',
    body: params,
  });
}
